/*
 * $Id: ObjectUtil.java 17 2011-05-09 08:46:18Z tweea $
 * Copyright(C) 2008 Matrix
 * All right reserved.
 */
package net.matrix.util;

public abstract class ObjectUtil
{
	public static <T> T isNull(T value, T replacement)
	{
		return value == null ? replacement : value;
	}

	public static <T> T nullIf(T value, T value2)
	{
		if(value == null || value2 == null){
			return null;
		}
		return value.equals(value2) ? null : value;
	}
}
